<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!-- -------------------------------------------- -->
<jsp:useBean id="employeBean"
	class="by.ostrovsky.webhousingsystem.bean.data.EmployeBean"
	scope="session" />
<c:set var="list" value="${employeBean.entityList}" />
<!-- -------------------------------------------- -->
<legend id="legend">Employee</legend>

<form name="editformemploye" method="post">
	<button type="button" onclick="EmBtnSaveDown()"
		class="btn btn-success actionbtnstyle">Save</button>
<!-- 	<button type="button" onclick="EmBtnCreateDown()" -->
<!-- 		class="btn btn-success actionbtnstyle">Create</button> -->
	<button type="button" onclick="EmBtnDeleteDown()"
		class="btn btn-danger actionbtnstyle">Delete</button>

	<table class="table">
		<tr>
			<td></td>
			<td>Id</td>
			<td>Name</td>
			<td>Surname</td>
			<td>Master</td>
			<td>Busy</td>
			<td>Specs</td>
			<td>Free at</td>
		</tr>
		<c:forEach items="${list}" var="item" varStatus="i">
			<tr>
				<td><input type="radio" name="selectedEllements"
					value="${i.index}"></td>
				<td><input type="text" name="id" class="form-control" value="${item.id}"
					readonly="readonly"></td>
				<td><input type="text" class="form-control" name="name"
					value="${item.name}"></td>
				<td><input type="text" class="form-control" name="surname"
					value="${item.surname}"></td>
				<td><c:choose>
						<c:when test="${item.isMaster == true}">
							<input type="text" class="form-control" name="isMaster"
								value="true">
						</c:when>
						<c:otherwise>
							<input type="text" class="form-control" name="isMaster"
								value="false">
						</c:otherwise>
					</c:choose></td>
				<td><c:choose>
						<c:when test="${item.isBusy == true}">
							<input type="text" class="form-control" name="isBusy"
								value="true">
						</c:when>
						<c:otherwise>
							<input type="text" class="form-control" name="isBusy"
								value="false">
						</c:otherwise>
					</c:choose></td>
				<td><input type="text" class="form-control" name="speciality"
					value="${item.speciality}"></td>
				<td><input type="text" class="form-control" name="freeAt"
					value="${item.freeAt}"></td>
			</tr>
		</c:forEach>
	</table>
</form>